import React, { Component } from 'react';
import FilmList from '../../components/FilmList';

class Like extends Component {
    state = {
        likeArr:[]
    }
    componentDidMount(){
        let likeArr = JSON.parse(localStorage.getItem("like"))
        this.setState({
            likeArr
        })
    }
    render() {
        let {likeArr} = this.state
        return (
            <div>
                <h1>我的点赞</h1>
                {likeArr.map(item=>{
                    return <FilmList key={item.filmId} {...this.props} {...item}></FilmList>
                })}
            </div>
        );
    }
}

export default Like;
